package com.blog.service.impl;

import com.blog.dao.UserMapper;
import com.blog.pojo.User;
import com.blog.service.UserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * Copyright (C), 2022
 * Author: 苏大大
 * Date: 2022-04-15 16:06
 * FileName: UserServiceImpl
 * Description:
 */
@Service
public class UserServiceImpl implements UserService {
    @Resource
    private UserMapper mapper;

    @Override
    public User Login(String account ,String password) {
        return mapper.Login(account, password);
    }

    @Override
    public List<User> queryAll() {
        return mapper.selectList(null);
    }

    @Override
    public int register(User user) {
        return mapper.insert(user);
    }

    @Override
    public int update(User user) {
        return mapper.updateById(user);
    }

    @Override
    public int updateAvatar(User user) {
        return mapper.updateAvatar(user);
    }

    @Override
    public User queryById(Long uid) {
        return mapper.selectById(uid);
    }
}
